@layout("/common/_curd/_container.html"){



</form>

<form data-url="/blog/fx_setting" method="post" class="form-horizontal" role="form" novalidate="novalidate">
	<!-- 表单 -->
	<div class="space-4"></div>
	<!-- #section:elements.form -->
	<div class="form-group" style="display:block">
		<label class="col-sm-2 control-label no-padding-right"> 首单一级佣金 </label>
		<div class="col-sm-8">
			<input type="text" id="one_fee" name="fx_settings.one_fee" required="" value="${fx.one_fee!0}" placeholder="首单一级" class="form-control">
		</div>
	</div>

	<div class="form-group" style="display:block">
		<label class="col-sm-2 control-label no-padding-right"> 首单二级佣金 </label>
		<div class="col-sm-8">
			<input type="text" id="two_fee" name="fx_settings.two_fee" required="" value="${fx.two_fee!0}" placeholder="首单二级" class="form-control">
		</div>
	</div>

	<div class="form-group" style="display:block">
		<label class="col-sm-2 control-label no-padding-right"> 非首单一级佣金 </label>
		<div class="col-sm-8">
			<input type="text" id="after_one_fee" name="fx_settings.after_one_fee" required="" value="${fx.after_one_fee!0}" placeholder="非首单一级" class="form-control">
		</div>
	</div>

	<div class="form-group" style="display:block">
		<label class="col-sm-2 control-label no-padding-right"> 非首单二级佣金 </label>
		<div class="col-sm-8">
			<input type="text" id="after_two_fee" name="fx_settings.after_two_fee" required="" value="${fx.after_two_fee!0}" placeholder="非首单二级" class="form-control">
		</div>
	</div>



	<div class="space-4"></div>
	<!-- 按钮 -->
	<div class="clearfix form-actions center" style="margin-top:15px;margin-bottom:5px;">
		<div class="col-md-offset-1 col-md-10">
			<button class="btn btn-info" type="submit" id="btn_save">
				<i class="ace-icon fa fa-check bigger-110"></i>
				修改
			</button>

			<!--&nbsp; &nbsp; &nbsp;-->
			<!--<button class="btn" type="button" id="btn_close">-->
				<!--<i class="ace-icon fa fa-close bigger-110"></i>-->
				<!--关闭-->
			<!--</button>-->
		</div>
	</div>
	<script src="/static/validate/jquery-html5Validate.js"></script>
	<script type="text/javascript">
		var layerIndex = parent.layer.getFrameIndex(window.name); //获取窗口索引

		$(function(){
			$("form").html5Validate(function() {
				if($("#form_token").val()==0){
					layer.alert("表单并未修改请勿提交!", {icon: 7,title:"提示"});
					return false;
				}
				if( typeof saveBefore === 'function' ){
					saveBefore();
				}
				$("#btn_save").attr("disabled","disabled");
				var appindex = appLoading();
				var $form = $(this);

				var ajax = new $ax($form.attr("data-url"), function(data){
					if (data.code === 0) {
						clearLoading(appindex);
						layer.msg(data.message, {shift: 1});
						setTimeout(function(){
							closeTab(true);
						},500);
						return false;
					} else {
						clearLoading(appindex);
						$("#btn_save").removeAttr("disabled","disabled");
						if(data.code===999){
							layer.alert(data.message, {icon: 2,title:"发生错误"});
						}
						else{
							layer.msg(data.message, {shift: 6,time:2000});
						}
						return false;
					}
				});
				ajax.data = $form.serialize();
				ajax.start();

				return false;
			}, {
				// novalidate: false
			});

			$("#btn_close").bind("click",function(){
				closeTab(("" == "true") ? true : false);
			});

			function closeTab(isReload){
				//未找到layerIndex代表为新增tab页
				if(typeof (layerIndex) == "undefined"){
					var tabId = "";
					var dataUrl = $("form").attr("data-url");
					if(typeof (dataUrl) == "undefined"){
						tabId = "btn_dict_view_";
					}else if(dataUrl.indexOf("save") > 0){
						tabId = "btn_dict_add";
					}else if(dataUrl.indexOf("update") > 0){
						tabId = "btn_dict_edit_";
					}else{
						tabId = "btn_dict_view_";
					}
					if(isReload){
						window.top.reloadTabById("dict")
					}
					window.top.autoClose(tabId,"dict");
				} else{
					if(isReload){
						parent.searchGrid();
					}
					parent.layer.close(layerIndex);
				}
			}

		});
	</script>
</form>

@}